how to pass data from DXL script to object text.

I have a script that creates a metric called PercentPass (a real), and I want to pass the value of PercentPass into a cell in a table (object 1150) and truncate it to 4 significant figures with percent sign (xx.xx%). Can anyone show me how to accomplish this?

Thanks,
Jim
Shieldslinger - Fri Mar 30 11:45:58 EDT 2012

Re: how to pass data from DXL script to object text.
SystemAdmin - Mon Apr 02 05:33:04 EDT 2012

real PercentPass = 12.3456789
 
int PercentPassInt = intOf(PercentPass)
int PercentPassDec = (intOf(PercentPass*100.0)) - (PercentPassInt *100)
 
print(PercentPassInt "." PercentPassDec "%")

 


Note: >= 100 you get 5 sf
Now set the Object Text(?) of object 1150

Adam

 

Re: how to pass data from DXL script to object text.
Shieldslinger - Mon Apr 02 10:51:13 EDT 2012

SystemAdmin - Mon Apr 02 05:33:04 EDT 2012

real PercentPass = 12.3456789
 
int PercentPassInt = intOf(PercentPass)
int PercentPassDec = (intOf(PercentPass*100.0)) - (PercentPassInt *100)
 
print(PercentPassInt "." PercentPassDec "%")

 


Note: >= 100 you get 5 sf
Now set the Object Text(?) of object 1150

Adam

 

Thanks, Adam!
But how, exactly, do I set the Object Text of Object 1150?

Thanks again,
Jim
P.S. can anyone point me towards a more accessible text than the IBM/Rational/Telelogic DXL Reference Manual? Something like a "DXL for Dummies" or an O'Reilly "DXL in a Nutshell"?

Re: how to pass data from DXL script to object text.
SystemAdmin - Mon Apr 02 11:16:40 EDT 2012

Shieldslinger - Mon Apr 02 10:51:13 EDT 2012
Thanks, Adam!
But how, exactly, do I set the Object Text of Object 1150?

Thanks again,
Jim
P.S. can anyone point me towards a more accessible text than the IBM/Rational/Telelogic DXL Reference Manual? Something like a "DXL for Dummies" or an O'Reilly "DXL in a Nutshell"?

void setPercentPass(real PercentPass, Module mRef, int AbsNo) {
    
        if(null(mRef)) {
                return()
        }
        
        int PercentPassInt = intOf(PercentPass)
        int PercentPassDec = (intOf(PercentPass*100.0)) - (PercentPassInt *100)
        
        // Note: this wont find Filtered objects
        Object oRef = object(AbsNo, mRef)
        if(!null(oRef)) {
                oRef."Object Text" = PercentPassInt "." PercentPassDec "%"
        }
}
 
Module m = current()
setPercentPass(12.3456789, m, 1150)

 


Sorry, I don't know of any learning DXL books.

Adam